home *** CD-ROM | disk | FTP | other *** search
- ; *** CLI-Copperdemo written by Gerson Kurz ***
- ;
- ; Size : 700 Bytes
- ;
- ; Hier ist ein Vollstaendig dokumentiertes Listing der CLI Copperliste.
- ; Mit diesem Wissen kann man bsp. eigene CLI Effekte leicht schreiben....
- ; Das Prg selbst hat eigentlich keinen Sinn, aber es zeigt was man so
- ; alles mit der Copperliste des CLIs anfangen kann. Es ist nicht ganz
- ; fehlerfrei (so schaltet es sich beispielsweise aus,wenn ein anderes
- ; Window angeklickt wird) aber man soll ja auch noch Platz zum
- ; Experimentieren haben...
- ; -----------------------------------------------------------
- ; Erstmal den Speicher & die gfx.lib oeffnen
- ; -----------------------------------------------------------
- o: move.l 4,a6 ; Execbase in a6
- jsr -132(a6) ; Execall FORBID
- move.l #$2000,d0 ; $2000 Bytes
- moveq #2,d1 ; ChipMEM
- jsr -$c6(a6) ; ExecCall ALLOCMEM
- move.l d0,mem ; Adresse retten
- beq.l fehler ; Error ?
- lea gfxname,a1 ; gfx.library
- jsr -408(a6) ; ExecCall OPENLIB
- move.l d0,gfxbase ; Gfxbase retten
- ; -----------------------------------------------------------
- ; Jetzt kopieren wir einfach unsere Copperliste in die Adresse,
- ; die wir uns vorher hergeholt haben...
- ; -----------------------------------------------------------
- wait: btst #5,$dff01f ; Blitter ready ?
- beq.s wait ; nein, warten
- lea copperliste,a1 ; Zeiger auf UserCopperliste
- move.l mem,a0 ; Zeiger auf Speicher
- coloop: move.l (a1)+,d0 ; Adresse rueberkopieren
- cmp.l #$fffffffe,d0 ; Letztes Langwort erreicht ?
- beq.s excolp ; Ja, dann kommt unser Einschub
- move.l d0,(a0)+ ; Langwort kopiern
- bra.s coloop ; Weiter in der Schleife
- excolp: move.w #$3009,d0 ; Ab Zeile $3009
- lea coltab,a1 ; Zeiger auf unsere Farben
- move.l #250,d3
- main: move.w (a1)+,d1 ; Erste Farbe rueberkopieren
- cmp.w #$fffe,d1 ; Letzte Farbe erreicht ?
- bne.s doit ; Nein, also weiter im Text
- lea coltab,a1 ; Sonst nochmal Farben initialisieren
- move.w (a1)+,d1 ; und nach d1 kopieren
- doit: move.w d0,(a0)+ ; Zeile in die Copperliste
- move.w #$fffe,(a0)+ ; Wait-Code in die Copperliste
- move.w #$0180,(a0)+ ; Zeiger auf Background Color
- move.w d1,(a0)+ ; Farbe in die Copperliste
- move.w #$0182,(a0)+ ; Zeiger auf Foreground-Color
- move.w #$fff,d2 ; Farbe Weiss nach d2
- sub.w d1,d2 ; Farbe d1 umdrehen
- move.w d2,(a0)+ ; Farbe in die Copperliste
- add.w #$0100,d0 ; Naechste Zeile
- cmp.w #$ff09,d0 ; Ende ?
- beq.s initpal ; Nein, also weiter
- dbra d3,main
- bra.s copend
- initpal:move.l #$ffffffde,(a0)+
- move.l #$0009,d0
- bra.s main
- copend: lea copperende,a1 ; Zeiger auf schluss der UserCopperliste
- coloop2:move.l (a1)+,d0 ; Naechstes Langwort nach d0
- move.l d0,(a0)+ ; und in die Copperliste
- cmp.l #$fffffffe,d0 ; Ende erreicht ?
- bne.s coloop2 ; nein, also nochmal
- ; -----------------------------------------------------------
- ; Copperliste einschalten
- ; -----------------------------------------------------------
- move.l gfxbase(pc),a0 ; Zeiger auf gfxbase
- adda.l #$32,a0 ; Zeiger auf CLI Copperliste
- move.w #$0080,$dff096 ; DmaCon abstellen
- move.l (a0),a1 ; alte copperliste raushauen
- move.l mem,(a0) ; Neue Copperliste reinhauen
- move.w #$8080,$dff096 ; und Dmacon wieder ein.
- ; -----------------------------------------------------------
- ; Und raus ins CLI !
- ; -----------------------------------------------------------
- exit: move.l 4,a6 ; Execbase nach a6
- move.l gfxbase,a1 ; gfxbase nach a1
- jsr -414(a6) ; ExecCall CLOSELIB
- fehler: jsr -138(a6) ; ExecCall PERMIT
- rts ; Zurueck ins CLI
- ; -----------------------------------------------------------
- ; Labels....
- ; -----------------------------------------------------------
- gfxname:dc.b 'graphics.library',0
- even
- gfxbase:dc.l 0
- copperliste:
- dc.l $2b01fffe ; Warte auf Zeile $2b01
- dc.l $01800000 ; Color00
- dc.l $01820679 ; Color01
- dc.l $01840abc ; Color02
- dc.l $01860345 ; Color03
- dc.l $01a00000 ; Color16
- dc.l $01a2079a ; Color17
- dc.l $01a40467 ; Color18
- dc.l $01a60acd ; Color19
- dc.l $01a80444 ; Color20
- dc.l $01aa0555 ; Color21 Alle diese Farbenwerte lassen sich vom User
- dc.l $01ac0666 ; Color22 Nach belieben einstellen
- dc.l $01ae0777 ; Color23
- dc.l $01b00888 ; Color24
- dc.l $01b20999 ; Color25
- dc.l $01b40aaa ; Color26
- dc.l $01b60bbb ; Color27
- dc.l $01b80ccc ; Color28
- dc.l $01ba0ddd ; Color29
- dc.l $01bc0eee ; Color30
- dc.l $01be0fff ; Color31
- dc.l $008e0581 ; Obere Linke Ecke des Screens
- dc.l $01000200 ; Keine Bitplanes
- dc.l $01040024 ; Prioritaet des Screens (!!!!)
- dc.l $009040c1 ; Untere Rechte Ecke des Screens
- dc.l $0092003c ; Begin der Bitplane DMA
- dc.l $009400d0 ; Ende der Bitplane DMA
- dc.l $01020000 ; Keine Bitplaneverschiebung
- dc.l $01080000 ; Modulo auf 0 (ungerade Bitplanes)
- dc.l $010a0000 ; Module auf 0 (gerade Bitplanes)
- dc.l $00e00000 ; Adresse Bitplane 0 HI
- dc.l $00e2b4d0 ; Adresse Bitplane 0 LOW
- dc.l $00e40001 ; Adresse Bitplane 1 HI
- dc.l $00e604d0 ; Adresse Bitplane 1 LOW
- dc.l $2c01fffe ; Warte auf $2c01
- dc.l $0100a200 ; Bitplanes fuer MedRes Einschalten
- dc.l $fffffffe ; Code - nur fuer internen Gebrauch in diesem Listing...
- copperende:
- dc.l $ffdffffe ; PAL ein
- dc.l $2c01fffe ; Warten auf $2c01
- dc.l $01000200 ; Bitplanes loeschen
- dc.l $fffffffe ; Ende der Copperliste
- mem: dc.l 0
- coltab:
- dc.w $000,$001,$002,$003,$004,$005,$006,$007,$008,$009,$00A
- DC.W $00B,$00C,$00D,$00E,$00F,$01F,$02F,$03F,$04F,$06F,$07F
- DC.W $08F,$09F,$0AF,$0BF,$0CF,$0DF,$0EF,$0FF,$0FE,$0FD,$0FC
- DC.W $0FA,$0FA,$0F9,$0F8,$0F7,$0F6,$0F5,$0F4,$0F3,$0F2,$0F1
- DC.W $0F0,$1F0,$2F0,$3F0,$4F0,$5F0,$6F0,$7F0,$8F0,$9F0,$AF0
- DC.W $BF0,$CF0,$DF0,$EF0,$FF0,$FE0,$FD0,$FC0,$FB0,$FA0,$F90
- DC.W $F80,$F70,$F60,$F50,$F40,$F30,$F20,$F10,$F00,$E00,$D00
- DC.W $C00,$B00,$A00,$900,$800,$700,$600,$500,$400,$300,$200
- DC.W $100
- dc.w $fffe